import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpTtappConfig {
  id!: number;
  appKey!: string;
  appSecret!: string;
  uniacid!: number;
  mchId?: unknown;
  payAppId?: unknown;
  payAppSecret?: unknown;
  isWxpay?: boolean;
  wxpayId?: number;
  isAlipay?: boolean;
  alipayId?: number;
  token?: unknown;
  salt?: unknown;
}

export const ImsYzdKpTtappConfigSchema = new EntitySchema({
  class: ImsYzdKpTtappConfig,
  properties: {
    id: { primary: true, type: 'number' },
    appKey: { type: 'string', length: 255 },
    appSecret: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    mchId: { type: 'unknown', columnType: 'longtext', nullable: true },
    payAppId: { type: 'unknown', columnType: 'longtext', nullable: true },
    payAppSecret: { type: 'unknown', columnType: 'longtext', nullable: true },
    isWxpay: { type: 'boolean', nullable: true },
    wxpayId: { type: 'number', nullable: true },
    isAlipay: { type: 'boolean', nullable: true },
    alipayId: { type: 'number', nullable: true },
    token: { type: 'unknown', columnType: 'longtext', nullable: true },
    salt: { type: 'unknown', columnType: 'longtext', nullable: true },
  },
});
